home *** CD-ROM | disk | FTP | other *** search
/ Aminet 3 / Aminet 3 - July 1994.iso / Aminet / dev / obero / Interfaces3_4.lha / Interfaces / Narrator.mod < prev    next >
Text File  |  1994-04-16  |  7KB  |  132 lines

  1. (*
  2. (*
  3. **  Amiga Oberon Interface Module:
  4. **  $VER: Narrator.mod 40.15 (28.12.93) Oberon 3.4
  5. **
  6. **   © 1993 by Fridtjof Siebert
  7. *)
  8. *)
  9.  
  10. MODULE Narrator;   (* $Implementation- *)
  11.  
  12. IMPORT e * := Exec;
  13.  
  14. CONST
  15.  
  16.                 (*          Device Options      *)
  17.  
  18.   newIORB     * = 0;       (* Use new extended IORB                *)
  19.   wordSync    * = 1;       (* Generate word sync messages          *)
  20.   sylSync     * = 2;       (* Generate syllable sync messages      *)
  21.  
  22.  
  23.  
  24.                 (*          Error Codes         *)
  25.  
  26.   noMem       * =  -2;      (* Can't allocate memory                *)
  27.   noAudLib    * =  -3;      (* Can't open audio device              *)
  28.   makeBad     * =  -4;      (* Error in MakeLibrary call            *)
  29.   unitErr     * =  -5;      (* Unit other than 0                    *)
  30.   cantAlloc   * =  -6;      (* Can't allocate audio channel(s)      *)
  31.   unimpl      * =  -7;      (* Unimplemented command                *)
  32.   noWrite     * =  -8;      (* Read for mouth without write first   *)
  33.   expunged    * =  -9;      (* Can't open, deferred expunge bit set *)
  34.   phonErr     * = -20;      (* Phoneme code spelling error                  *)
  35.   rateErr     * = -21;      (* Rate out of bounds                   *)
  36.   pitchErr    * = -22;      (* Pitch out of bounds                          *)
  37.   sexErr      * = -23;      (* Sex not valid                        *)
  38.   modeErr     * = -24;      (* Mode not valid                       *)
  39.   freqErr     * = -25;      (* Sampling frequency out of bounds     *)
  40.   volErr      * = -26;      (* Volume out of bounds         *)
  41.   dCentErr    * = -27;      (* Degree of centralization out of bounds *)
  42.   centPhonErr * = -28;      (* Invalid central phon                 *)
  43.  
  44.  
  45.  
  46.                 (* Input parameters and defaults *)
  47.  
  48.   defPitch    * = 110;         (* Default pitch                        *)
  49.   defRate     * = 150;         (* Default speaking rate (wpm)                  *)
  50.   defVol      * = 64;          (* Default volume (full)                *)
  51.   defFreq     * = 22200;       (* Default sampling frequency (Hz)      *)
  52.   male        * = 0;           (* Male vocal tract                     *)
  53.   female      * = 1;           (* Female vocal tract                   *)
  54.   naturalF0   * = 0;           (* Natural pitch contours               *)
  55.   roboticF0   * = 1;           (* Monotone pitch                       *)
  56.   manualF0    * = 2;           (* Manual setting of pitch contours     *)
  57.   defSex      * = male;        (* Default sex                                  *)
  58.   defMode     * = naturalF0;   (* Default mode                 *)
  59.   defArtic    * = 100;         (* 100% articulation (normal)           *)
  60.   defCentral  * = 0;           (* No centralization                    *)
  61.   defF0Pert   * = 0;           (* No F0 Perturbation                   *)
  62.   defF0Enthus * = 32;          (* Default F0 enthusiasm (in 32nds)     *)
  63.   defPriority * = 100;         (* Default speaking priority            *)
  64.  
  65.  
  66.                         (*      Parameter bounds        *)
  67.  
  68.   minRate     * = 40;          (* Minimum speaking rate                *)
  69.   maxRate     * = 400;         (* Maximum speaking rate                *)
  70.   minPitch    * = 65;          (* Minimum pitch                        *)
  71.   maxPitch    * = 320;         (* Maximum pitch                        *)
  72.   minFreq     * = 5000;        (* Minimum sampling frequency           *)
  73.   maxFreq     * = 28000;       (* Maximum sampling frequency           *)
  74.   minVol      * = 0;           (* Minimum volume                       *)
  75.   maxVol      * = 64;          (* Maximum volume                       *)
  76.   minCent     * = 0;           (* Minimum degree of centralization     *)
  77.   maxCent     * = 100;         (* Maximum degree of centralization     *)
  78.  
  79.  
  80. TYPE
  81.  
  82.                 (*    Standard Write request    *)
  83.  
  84.   NarratorPtr * = UNTRACED POINTER TO Narrator;
  85.   Narrator * = STRUCT (message * : e.IOStdReq)
  86.             (* Standard IORB                *)
  87.     rate * : INTEGER;                   (* Speaking rate (words/minute) *)
  88.     pitch * : INTEGER;                  (* Baseline pitch in Hertz              *)
  89.     mode * : INTEGER;                   (* Pitch mode                   *)
  90.     sex * : INTEGER;                    (* Sex of voice                 *)
  91.     chMasks * : e.APTR;                 (* Pointer to audio alloc maps  *)
  92.     nmMasks * : INTEGER;                (* Number of audio alloc maps   *)
  93.     volume * : INTEGER;                 (* Volume. 0 (off) thru 64      *)
  94.     sampfreq * : INTEGER;               (* Audio sampling freq                  *)
  95.     mouths * : BOOLEAN;                 (* If non-zero, generate mouths *)
  96.     chanmask * : e.BYTE;                (* Which ch mask used (internal)*)
  97.     numchan * : e.BYTE;                 (* Num ch masks used (internal) *)
  98.     flags * : SHORTSET;                 (* New feature flags            *)
  99.     f0enthusiasm * : SHORTINT;          (* F0 excursion factor          *)
  100.     f0perturb * : SHORTINT;             (* Amount of F0 perturbation    *)
  101.     f1adj * : SHORTINT;                 (* F1 adjustment in ±5% steps   *)
  102.     f2adj * : SHORTINT;                 (* F2 adjustment in ±5% steps   *)
  103.     f3adj * : SHORTINT;                 (* F3 adjustment in ±5% steps   *)
  104.     a1adj * : SHORTINT;                 (* A1 adjustment in decibels    *)
  105.     a2adj * : SHORTINT;                 (* A2 adjustment in decibels    *)
  106.     a3adj * : SHORTINT;                 (* A3 adjustment in decibels    *)
  107.     articulate * : SHORTINT;            (* Transition time multiplier   *)
  108.     centralize * : SHORTINT;            (* Degree of vowel centralization *)
  109.     centphon * : e.APTR;                (* Pointer to central ASCII phon  *)
  110.     avBias * : SHORTINT;                (* AV bias                      *)
  111.     afBias * : SHORTINT;                (* AF bias                      *)
  112.     priority * : SHORTINT;              (* Priority while speaking      *)
  113.     pad1 * : SHORTINT;                  (* For alignment                *)
  114.   END;
  115.  
  116.  
  117.                 (*    Standard Read request     *)
  118.  
  119.   MouthPtr * = UNTRACED POINTER TO Mouth;
  120.   Mouth * = STRUCT (voice * : Narrator) (* Speech IORB                 *)
  121.     width  *: e.BYTE;                   (* Width (returned value)      *)
  122.     height *: e.BYTE;                   (* Height (returned value)     *)
  123.     shape  -: e.BYTE;                   (* Internal use, do not modify *)
  124.     sync   *: e.BYTE;                   (* Returned sync events        *)
  125.   END;
  126.  
  127. END Narrator.
  128.  
  129.  
  130.  
  131.  
  132.